package com.yiligi.myserver.service.Impl;

import com.yiligi.myserver.mapper.FileMapper;
import com.yiligi.myserver.pojo.Files;
import com.yiligi.myserver.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileServiceImpl implements FileService {

    @Autowired
    private FileMapper fileMapper;

    @Override
    public List<Files> selectAllFile() {
        return fileMapper.selectAllFile();
    }

    @Override
    public int selectFileCount(String name, String type) {
        return fileMapper.selectFileCount(name,type);
    }

    @Override
    public List<Files> selectFilePage(int pageNum, int pageSize, String name, String type) {
        return fileMapper.selectFilePage(pageNum,pageSize,name,type);
    }

    @Override
    public int uploadFile(Files files) {
        return fileMapper.uploadFile(files);
    }

    @Override
    public int deleteFile(int id) {
        return fileMapper.deleteFile(id);
    }

    @Override
    public Boolean delBatchFile(List<Integer> files) {
        return fileMapper.delBatchFile(files);
    }

    @Override
    public List<Files> getFileMd5(String md5) {
        return fileMapper.getFileMd5(md5);
    }

    @Override
    public String getUrl(String avatar_url) {
        return fileMapper.getUrl(avatar_url);
    }
}
